/*!
sciter window处理模块
*/
use crate::events;
use sciter::window::Flags;

pub fn create_main(res: &[u8]) {
    let mut window = sciter::WindowBuilder::with_flags(Flags::SW_MAIN)
        .with_size((1024, 600))
        .with_pos((1920 / 2 - 512, 1080 / 2 - 300))
        .create();
    window.archive_handler(res).unwrap();
    window.event_handler(events::Events {});
    window.load_file("this://app/index.html");
    window.run_app();
}

pub fn service(res: &[u8]) {
    let mut window = sciter::WindowBuilder::with_flags(Flags::SW_MAIN).create();
    window.archive_handler(res).unwrap();
    window.event_handler(events::Events {});
    window.load_file("this://app/tray.html");
    window.run_loop();
}
